//
//  ReferTableViewCell.m
//  Village
//
//  Created by longrise on 2017/9/11.
//  Copyright © 2017年 程虎. All rights reserved.
//

#import "ReferTableViewCell.h"
#import "UITableViewCell+FSAutoCountHeight.h"
#import "Masonry.h"
@implementation ReferTableViewCell

- (instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self addAllViews];
        
    }
    return self;
}

- (void)addAllViews
{

    _leftlable = [[UILabel alloc] init];
    _leftlable.font = [UIFont systemFontOfSize:14*kScreenScaleX];
    _leftlable.textColor = [Util colorWithHexString:@"666666"];
     [_leftlable setTextAlignment : NSTextAlignmentLeft] ;
    _leftlable.text = @"123";
    [self.contentView addSubview:_leftlable];
    [_leftlable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(13*kScreenScaleX);//使左边等于self.view的左边，间距为0
        make.width.mas_equalTo(130*kScreenScaleX);
        make.height.mas_equalTo(16*kScreenScaleY);
        make.centerY.equalTo(self);
    }];
    
    _rightlable = [[UILabel alloc] init];
    _rightlable.textColor = [Util colorWithHexString:@"666666"];
    _rightlable.font = [UIFont systemFontOfSize:14];
    _rightlable.numberOfLines = 0;
      [_rightlable setTextAlignment : NSTextAlignmentRight] ;
    [self.contentView addSubview:_rightlable];
    [_rightlable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.mas_right).offset(-20*kScreenScaleX);//使左边等于self.view的左边，间距为0
        make.width.mas_equalTo(180*kScreenScaleX);
        make.centerY.equalTo(self);
    }];
    
    _image = [[UIImageView alloc] init];
    _image.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:_image];
    [_image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(109*kScreenScaleX);//使左边等于self.view的左边，间距为0
        make.width.mas_equalTo(142*kScreenScaleX);
        make.height.mas_equalTo(99*kScreenScaleY);
        make.centerY.equalTo(self);
    }];
    
    self.FS_cellBottomView = _rightlable;//尽量传入底视图，不传也不会报错
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
